package com.geezdata.cps.sdk3rd.miya.response;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.geezdata.cps.base.exceptions.MyException;
import com.geezdata.cps.sdk3rd.miya.domain.MiyaOrder;


public class MiyaGetOrderResult extends MiyaResult{
    private MiyaOrder miyaOrder;
    private String requestId;
   
    public MiyaOrder getMiyaOrder() {
        return miyaOrder;
    }

    public void setMiyaOrder(MiyaOrder miyaOrder) {
        this.miyaOrder = miyaOrder;
    }

    public String getRequestId() {
        return requestId;
    }
    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

	@Override
	public void parseResponseJson(JSONObject responseJson) throws MyException {
		JSONObject content = responseJson.getJSONObject("content");
		JSONArray miyaOrders = content.getJSONArray("order_response");
		this.miyaOrder = MiyaOrder.convert(miyaOrders.getJSONObject(0));
        this.requestId = responseJson.getString("request_id");
	}
}
